Skip to content

Chi-Squared Test

Tags
PAS
Cegep/2
Word count
249 words
Reading time
2 minutes

Test to determine whether two qualitative variables are independent

H0: variables are independent
H1: variables are dependent

Steps:

  1. Determine the degrees of freedom
  2. Construct the table of expected frequencies
  3. Compute chi-squared
  4. Use probability table to find p-value of chi-squared

Only valid when $n \ge 30$ and $e_{ij} \ge 5 \forall i, j$

Examples

A randomly selected sample was asked to choose their preferred musical genres from a set of choices. Do the results of the sample indicate (at 𝛼 = 5%) whether musical preferences are dependent of the generation to which belongs the respondents?

Classical/JazzHip Hop/RapPopRock/AlternativeTotal
Boomers326111867
Gen X189233181
Gen Y1121391788
Gen Z831251175
Total69679877311

H0: the musical preferences are independent of the generation.
H1: the musical preferences are dependent of the generation.

df=(n1)(m1)=(41)(41)=9χ92=i,j(oijeij)2eij=(326769311)26769311+(66767311)26767311++(117577311)2757731170.81p=P(X92>70.81)1.051011<5%

Therefore, we reject H0 and conclude that preferred musical genres are dependent of the generation.

Contributors

Changelog